﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using RM2012Service.DataService;
using System.Data.SqlClient;
using System.Data;

namespace RM2012Service.DataAccess
{
    public class MenuDAO
    {
        DBConnection db;

        public MenuDAO()
        {
            db = new DBConnection();
        }

        public DataTable GetAllMenu()
        {
            return db.ExecuteDataTable("GetAllMenuFull", null);
        }

        public DataSet GetAllMenuDataSet()
        {
            return db.ExecuteDataSet("GetAllMenuFull", "Menu", null);
        }

        public DataTable GetMenuById(string menuId)
        {
            SqlParameter param = new SqlParameter("@MenuId", SqlDbType.VarChar, 6);
            param.Value = menuId;
            return db.ExecuteDataTable("GetMenuByIdFull", param);
        }
    }
}
